package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 体验金投标待收记录实体
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "additional_experience_collection")
public class ExperienceCollection {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 用户 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /** 体验券 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "experience_id")
    private Experience experience;

    /** 体验券投标 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "experience_tender_id")
    private ExperienceTender experienceTender;

    /** 借款标 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "borrow_id")
    private Borrow borrow;

    /** 待收id */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "collection_id")
    private BorrowCollection collection;

    /** 期数 */
    private byte period;

    /** 状态（0：投标待处理，1：成功，2：失败） */
    private byte status;

    /** 体验券本金 */
    private double capital;

    /** 产生的利息 */
    private double interest;

    /** 添加时间 */
    private Date addTime;

    /** 预计还款时间 */
    private Date repaymentTime;

    /** 还款时间 */
    private Date repaymentYesTime;

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 要设置的主键
     */
    public void setId(long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Experience getExperience() {
        return experience;
    }

    public void setExperience(Experience experience) {
        this.experience = experience;
    }

    public ExperienceTender getExperienceTender() {
        return experienceTender;
    }

    public void setExperienceTender(ExperienceTender experienceTender) {
        this.experienceTender = experienceTender;
    }

    public Borrow getBorrow() {
        return borrow;
    }

    public void setBorrow(Borrow borrow) {
        this.borrow = borrow;
    }

    public BorrowCollection getCollection() {
        return collection;
    }

    public void setCollection(BorrowCollection collection) {
        this.collection = collection;
    }

    /**
     * 获取期数
     *
     * @return 期数
     */
    public byte getPeriod() {
        return period;
    }

    /**
     * 设置期数
     *
     * @param period 要设置的期数
     */
    public void setPeriod(byte period) {
        this.period = period;
    }

    /**
     * 获取状态（0：投标待处理，1：成功，2：失败）
     *
     * @return 状态（0：投标待处理，1：成功，2：失败）
     */
    public byte getStatus() {
        return status;
    }

    /**
     * 设置状态（0：投标待处理，1：成功，2：失败）
     *
     * @param status 要设置的状态（0：投标待处理，1：成功，2：失败）
     */
    public void setStatus(byte status) {
        this.status = status;
    }

    public double getCapital() {
        return capital;
    }

    public void setCapital(double capital) {
        this.capital = capital;
    }

    /**
     * 获取产生的利息
     *
     * @return 产生的利息
     */
    public double getInterest() {
        return interest;
    }

    /**
     * 设置产生的利息
     *
     * @param interest 要设置的产生的利息
     */
    public void setInterest(double interest) {
        this.interest = interest;
    }

    /**
     * 获取添加时间
     *
     * @return 添加时间
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置添加时间
     *
     * @param addTime 要设置的添加时间
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取预计还款时间
     *
     * @return 预计还款时间
     */
    public Date getRepaymentTime() {
        return repaymentTime;
    }

    /**
     * 设置预计还款时间
     *
     * @param repaymentTime 要设置的预计还款时间
     */
    public void setRepaymentTime(Date repaymentTime) {
        this.repaymentTime = repaymentTime;
    }

    /**
     * 获取还款时间
     *
     * @return 还款时间
     */
    public Date getRepaymentYesTime() {
        return repaymentYesTime;
    }

    /**
     * 设置还款时间
     *
     * @param repaymentYesTime 要设置的还款时间
     */
    public void setRepaymentYesTime(Date repaymentYesTime) {
        this.repaymentYesTime = repaymentYesTime;
    }
}


